Skip to content

fix: Throw correct exception if opening read-only file for writing#1135

Merged
vbreuss merged 1 commit intoTestableIO:mainfrom
WestRyanK:main
Jul 25, 2024
Merged

fix: Throw correct exception if opening read-only file for writing#1135
vbreuss merged 1 commit intoTestableIO:mainfrom
WestRyanK:main

Conversation

@WestRyanK
Copy link
Copy Markdown
Contributor

Mock classes did not match .net's behavior of throwing UnauthorizedAccessException when opening read-only files with FileAccess.Write, making it impossible to test those scenarios.

This commit fixes the mock classes so that the exception will be thrown correctly.

Mock classes did not match .Net's behavior of throwing
UnauthorizedAccessExceptions when opening readonly files with
FileAccess.Write, making it impossible to test those scenarios.

This commit fixes the mock classes so that the exception will
be thrown correctly.
@vbreuss vbreuss changed the title fix: Throw exception if opening read-only file for writing fix: Throw correct exception if opening read-only file for writing Jul 25, 2024
Copy link
Copy Markdown
Member

@vbreuss vbreuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @WestRyanK for reporting and fixing this error.
I just slightly adapted the PR title, otherwise the pull request looks good to me and will be released shortly!

@vbreuss vbreuss merged commit f4afa40 into TestableIO:main Jul 25, 2024
@github-actions
Copy link
Copy Markdown

This is addressed in release v21.0.29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: released Issues that are released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants